package model.entity;

import java.util.HashSet;

import model.ability.PassiveSkill;
import model.item.BrawlWeapon;
import model.item.OneHandedWeapon;
import model.item.RangedWeapon;
import model.item.StaffWeapon;
import model.item.TwoHandedWeapon;
import model.map.MapPoint;
import model.stats.StatsContainer;
import model.core.AbilitiesLibrary;
/**
 * 
 * @author srhinson
 *change the equip methods to change the weapon ability in defaultAbility
 *	change coincides with a design change in how abilities are referenced
 */
public class Smasher extends Avatar{

	private PassiveSkill oneHandSkill;
	private PassiveSkill twoHandSkill;
	private PassiveSkill brawlSkill;
	

	public Smasher(String name, MapPoint origin, StatsContainer stats,
			MovementType movement, int obs, int bar, int bind, DirectionalGraphicSet graphics){
		super(name, "smasher", origin, stats,
				movement, obs, bar, bind, graphics);
		oneHandSkill=new PassiveSkill("oneHanded");
		twoHandSkill=new PassiveSkill("twoHanded");
		brawlSkill=new PassiveSkill("brawling");
		defaultAttack=AbilitiesLibrary.getInstance().getMapAbility("fisting");
	}
	
	public Smasher(){
		super();
		oneHandSkill=new PassiveSkill("oneHanded");
		twoHandSkill=new PassiveSkill("twoHanded");
		brawlSkill=new PassiveSkill("brawling");
		defaultAttack=AbilitiesLibrary.getInstance().getMapAbility("fisting");
	}
	
	/**
	 * overwrite equip methods to prevent equipping unusable weapon
	 */
	public void equipOneHandedWeapon(OneHandedWeapon weapon){
		super.equipOneHand(weapon);
		defaultAttack=AbilitiesLibrary.getInstance().getMapAbility("oneHand");
		defaultAttack.setGoverningSkill(oneHandSkill);
	}

	public void equipTwoHandedWeapon(TwoHandedWeapon weapon){
		super.equipTwoHand(weapon);
		defaultAttack=AbilitiesLibrary.getInstance().getMapAbility("twoHanded");
		defaultAttack.setGoverningSkill(twoHandSkill);
	}
	
	public void equipBrawl(BrawlWeapon weapon){
		super.equipBrawl(weapon);
		defaultAttack=AbilitiesLibrary.getInstance().getMapAbility("brawl");
		defaultAttack.setGoverningSkill(brawlSkill);
	}
	
	public void equipRanged(RangedWeapon weapon) {
		return;
	}
	
	public void equipStaff(StaffWeapon weapon){
		return;
	}

	public void enchant(int baseValue) {
	}

	public void notifyOfDeath(Entity entity) {
		
	}
	
    public HashSet<PassiveSkill> getSkillList(){
    	HashSet<PassiveSkill> skillList=super.getSkillList();
    	skillList.add(brawlSkill);
    	skillList.add(oneHandSkill);
    	skillList.add(twoHandSkill);
    	return skillList;
    }
    
    public void levelup(){
    	super.levelup();
    	stats.levelStrength(3);
    	stats.levelAgility(1);
    	stats.levelHardiness(3);
    	stats.levelIntellect(1);
    }
}
